@layout("/common/container.html", {"title" : "启动流程"}){
<style>
    body {
        background: #fff;
    }
    .work-flow-form.e-form .col-form-label{
        text-align: right;
    }
</style>
<form class="e-form work-flow-form">
    <input type="hidden" name="businessKey" value="${businessKey}">
    <input type="hidden" name="businessTitle" value="${businessTitle}">
    <input type="hidden" name="businessDetailsUrl" value="${businessDetailsUrl}">
    <div class="row">
        <!-- str:表单区域 -->
        <div class="col-12">
            @if(hasStartFormKey){
                ${startFormData}
            @} else {
                @for(property in startFormData.formProperties) {
                    @if(property.type.name != 'javascript') {
                    <div class="form-group row">
                        <label class="col-form-label col-4" for="${property.id}">
                            @if(@property.isRequired()) {
                                <span class="required">*</span>
                            @}
                            ${property.name}：
                        </label>
                        <div class="col-6">
                            @var commonProperty = null;
                            @if(@property.isRequired()){
                                @commonProperty += "required ";
                            @}
                            @if(!@property.isWritable()){
                                @commonProperty += "readonly='true' ";
                            @}

                            @if(property.type.name == 'string') {
                                <input type="text" class="form-control" id="${property.id}" name="${property.id}" ${commonProperty}>
                            @}
                            @if(property.type.name == 'long') {
                                <input type="number" class="form-control" id="${property.id}" name="${property.id}" ${commonProperty}>
                            @}
                            @if(property.type.name == 'boolean') {
                                <input type="text" class="form-control" id="${property.id}" name="${property.id}" ${commonProperty}>
                            @}
                            @if(property.type.name == 'date') {
                                <input type="text" class="form-control date-picker" data-date-format="${strutil.toLowerCase(@property.getType().getInformation('datePattern'))}" id="${property.id}" name="${property.id}" ${commonProperty}>
                            @}
                            @if(property.type.name == 'enum') {
                                <select class="form-control select-picker" id="${property.id}" name="${property.id}" ${commonProperty}>
                                    @for(option in @property.getType().getInformation("values")) {
                                        <option value="${option.key}">${option.value}</option>
                                    @}
                                </select>
                            @}
                        </div>
                    </div>
                    @} else {
                        <script type="text/javascript">${property.value}</script>
                    @}
                @}
            @}
        </div>
        <!-- end:表单区域 -->
        <div class="col-12 text-center">
            <button id="start-process" type="button" class="btn btn-success"><i class="la la-play"></i>启动流程</button>
        </div>
    </div>
</form>
<!--begin::页面脚本 -->
<script>
    // 流程id
    let processDefinitionId = '${processDefinitionId}';
</script>
<#script src="static/modular/activiti/process/definition/start-form.js" />
<!--end::页面脚本 -->
@}